<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output omit-xml-declaration="yes"/>
	<xsl:param name="id"/>
	<xsl:template match="/map">{
	"map" : {
		"id" : "<xsl:value-of select="$id"/>",
		"gsid" : "<xsl:value-of select="@gsid"/>",
		"name" : "<xsl:value-of select="name"/>",
		"modes" : [ <xsl:for-each select="modes/mode">{
			"mode" : "<xsl:value-of select="@type"/>",
			"maptypes" : [ <xsl:for-each select="maptype">{
				"players" : "<xsl:value-of select="@players"/>",
				"type" : "<xsl:value-of select="@type"/>"
			}<xsl:if test="position() != last()">, </xsl:if></xsl:for-each> ]
		}<xsl:if test="position() != last()">, </xsl:if></xsl:for-each> ]
	}
}</xsl:template>
</xsl:stylesheet>